package cn.com.cetccst.devicerestriction;

import cn.com.cetccst.tools.log.CommonLogger;

public enum RestrictionModel {
    camera(Restriction.CAMERA, R.string.restriction_text_camera, R.drawable.ic_camera_block),
    microPhone(Restriction.MICROPHONE, R.string.restriction_text_microphone, R.drawable.ic_microphone_block),
    sdCard(Restriction.SDCARD, R.string.restriction_text_sdcard, R.drawable.ic_sd_block),
    screenShot(Restriction.SCREEN_SHOT, R.string.restriction_text_screenshot, R.drawable.ic_screenshot_block),
    autoTime(Restriction.AUTO_TIME, R.string.restriction_text_autoTime, R.drawable.ic_autotime_block),
    usbTransfer(Restriction.USB_TRANSFER, R.string.restriction_text_usb_transfer, R.drawable.ic_usb_block);

    public String name;
    public int resLabelId;
    public int drawableId;

    RestrictionModel(String name, int resLabelId, int drawableId) {
        this.name = name;
        this.resLabelId = resLabelId;
        this.drawableId = drawableId;
    }

    @Override
    public String toString() {
        return name;
    }

    public static RestrictionModel lookUp(String name) {
        RestrictionModel restriction = null;
        try {
            restriction = RestrictionModel.valueOf(name);
        } catch (IllegalArgumentException e) {
            CommonLogger.warn("RestrictionModel not define name " + name);
        }
        return restriction;
    }
}
